package com.dl.mall.entity.user;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;

/**
 * @author DL
 * @create 2022-01-17 13:20
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "User",description = "用户实体类")
public class User implements Serializable {
    @ApiModelProperty(value = "用户id",example = "")
    private String userId;
    @ApiModelProperty(value = "用户名",example = "")
    private String username;
    @ApiModelProperty(value = "密码",example = "")
    private String password;
    @ApiModelProperty(value = "状态",example = "")
    private Integer state;
    @ApiModelProperty(value = "创建时间",example = "")
    private Timestamp createTime;
    @ApiModelProperty(value = "昵称",example = "")
    private String nickname;
    @ApiModelProperty(value = "电话",example = "")
    private String phone;
    @ApiModelProperty(value = "电子邮箱",example = "")
    private String email;
    @ApiModelProperty(value = "头像地址",example = "")
    private String avatar;
    @ApiModelProperty(value = "性别",example = "")
    private Integer gender;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") // 将Date转换成String 一般后台传值给前台时
    @DateTimeFormat(pattern = "yyyy-MM-dd")// 将String转换成Date，一般前台给后台传值时用
    @ApiModelProperty(value = "生日",example = "")
    private Date birthday;//
    @ApiModelProperty(value = "角色名",example = "")
    private String roleName;
}
